﻿<%@ Page StylesheetTheme="Skin1" Language="C#" MasterPageFile="~/LTR/MlyLtrMaster.Master"
    AutoEventWireup="true" CodeBehind="SubContractors.aspx.cs" Inherits="MLY.LTR.Clients.SubContractors"
    Title='<%$Dict:ClientSubContractors.Title %>' %>

<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1" %>
<asp:Content ID="title" ContentPlaceHolderID="titleHolder" runat="server">
    <title>
        <asp:Literal ID="Literal21" Text='<%$Dict:Titles.subContractors%>' runat="server"></asp:Literal>
    </title>
</asp:Content>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <asp:Label ID="lblSuccessDelete" runat="server" Text="<%$Dict:SubContractors.lblSuccessDelete %>"
        ForeColor="Green" Font-Bold="True" Font-Size="16pt"></asp:Label><br />
    <asp:Label ID="lblErrDelete" runat="server" Text="<%$Dict:SubContractors.lblErrDelete %>"
        ForeColor="Red" Font-Bold="True" Font-Size="16pt"></asp:Label>
    <asp:GridView SkinID="GridViewSkin" ID="GridView1" runat="server" AutoGenerateColumns="False"
        DataSourceID="ObjectDataSource1" OnSorting="GridView1_Sorting" OnPreRender="GridView1_PreRender"
        PageSize='<%# Session["DefaultLinesinGrid"] != null ?  int.Parse(Session["DefaultLinesinGrid"].ToString()) : 20 %>'
        AllowPaging="true" >
        <HeaderStyle CssClass="dottedLineRightHeader" />
        <Columns>
            <asp:TemplateField HeaderStyle-CssClass="dottedLineRightHeader" ItemStyle-HorizontalAlign="Center"
                HeaderStyle-Width="83">
                <HeaderTemplate>
                    <asp:Label ID="Label2" runat="server" CssClass="whiteLbl" Text="<%$Dict:SubContractors.AddRel%>"></asp:Label>
                    <br />
                    <asp:ImageButton ID="ImageButton1" runat="server" PostBackUrl="<%#&quot;SubContractorCard.aspx?ContractorId=-1&quot;%>"
                        ImageUrl="~/Images/add_line_icon.png" />
                </HeaderTemplate>
                <ItemTemplate>
                    <table border="0" cellpadding="0" cellspacing="0">
                        <tr>
                            <td style="width: 41px">
                                <asp:ImageButton ID="btnDelete" runat="server" CommandArgument='<%# Eval("OrganizationId") %>'
                                    ImageUrl="~/Images/massage/delete_icon.png" OnClick="btnDelete_OnClick" />
                            </td>
                            <td>
                                <img src="/Images/massage/line_division_between-icons.png" />
                            </td>
                            <td style="width: 40px;">
                                <asp:ImageButton runat="server" ID="HyperLinkEdit" PostBackUrl="<%#String.Format(&quot;SubContractorCard.aspx?ContractorId={0}&quot;,Eval(&quot;OrganizationId&quot;))%>"
                                    ImageUrl="~/Images/massage/magnify_massage_icon.png" />
                            </td>
                        </tr>
                    </table>
                    <cc1:ConfirmButtonExtender TargetControlID="btnDelete" runat="server" ConfirmText=" are you sure you want to delete this message? ">
                    </cc1:ConfirmButtonExtender>
                </ItemTemplate>
            </asp:TemplateField>
            <asp:BoundField HeaderStyle-CssClass="dottedLineRightHeader" HeaderStyle-Width="106"
                DataField="OrganizationName" HeaderText="<%$Dict:SubContractors.OrganizationName%>"
                SortExpression="OrganizationName" />
            <asp:BoundField HeaderStyle-CssClass="dottedLineRightHeader" DataField="ContactPerson"
                HeaderStyle-Width="118" HeaderText="<%$Dict:SubContractors.ContactPerson%>" SortExpression="ContactPerson" />
            <asp:TemplateField HeaderStyle-CssClass="dottedLineRightHeader" HeaderText="<%$Dict:SubContractors.ContactPersonEmail%>"
                HeaderStyle-Width="123" SortExpression="ContactPersonEmail">
                <ItemTemplate>
                    <a href="mailto:<%# Eval("OrganizationEmail") %>">
                        <%# Eval("OrganizationEmail") %></a>
                </ItemTemplate>
            </asp:TemplateField>
            <asp:TemplateField HeaderStyle-CssClass="dottedLineRightHeader" HeaderText="<%$Dict:SubContractors.WebSite%>"
                HeaderStyle-Width="134" SortExpression="WebSite">
                <ItemTemplate>
                    <a href="http://<%# Eval("WebSite") %>">
                        <%# Eval("WebSite")%></a>
                </ItemTemplate>
            </asp:TemplateField>
            <asp:TemplateField HeaderStyle-CssClass="dottedLineRightHeader" SortExpression="countMe"
                HeaderStyle-Width="100">
                <HeaderTemplate>
                    <asp:HyperLink Text="<%$Dict:SubContractors.OpenedOrders%>" runat="server" ID="openedOrdersHeader"
                        ForeColor="White"></asp:HyperLink>
                </HeaderTemplate>
                <ItemTemplate>
                    <asp:HyperLink Text='<%# Bind("countMe") %>' ID="HyperLinkWOCount" runat="server"
                        NavigateUrl="<%#String.Format(&quot;../gridBasePage.aspx?ContractorId={0}&isclient=1&quot;,Eval(&quot;OrganizationId&quot;))%>">
                                  
                    </asp:HyperLink>
                </ItemTemplate>
            </asp:TemplateField>
            <asp:BoundField DataField="totalSum" HeaderStyle-CssClass="dottedLineRightHeader" HeaderStyle-Width="60" HeaderText="<%$Dict:SubContractors.totalSum%>"
                SortExpression="totalSum" Visible="True" />
        </Columns>
    </asp:GridView>
    <asp:ObjectDataSource ID="ObjectDataSource1" runat="server" OldValuesParameterFormatString="original_{0}"
        SelectMethod="GetOrganizationShortByClientId" TypeName="MLY.Bll.OrganizationShort">
        <SelectParameters>
            <asp:SessionParameter DefaultValue="-1" Name="clientId" SessionField="OrganizationId"
                Type="Int32" />
            <asp:Parameter Direction="input" Type="string" Name="p_sortExpression"></asp:Parameter>
            <asp:Parameter Direction="input" Type="string" Name="p_sortDirection"></asp:Parameter>
        </SelectParameters>
    </asp:ObjectDataSource>
    <div id="divEmptyGrid" visible="false" runat="server">
        <asp:Label ID="lblNoMessages" Text="<%$Dict:SubContractors.lblNoMessages%>" runat="server"></asp:Label>
        <asp:ImageButton ID="imgAddNewOnNoRows" ImageUrl="~/Images/imgbtnAdd.png" runat="server"
            OnClick="imgAddNewOnNoRows_Click" />
    </div>
</asp:Content>
